www.gusucode.com > WordPress Redis 缓存清除插件 v1.2PHP源码程序 > WordPress Redis 缓存清除插件 v1.2/wordpressrediscache/wordpress-redis-cache/缓存清除插件/include/themes.php

    <?php
class sp_redis_html{
	
	function sp_redis_menu_delete(){
		if (get_option('sp_redis_url') == ''){
			?>
<div class="wrap">
    <h1>Redis清除缓存</h1>
	<p>注意:此插件需要配合带有Redis缓存功能的ndex.php,可以到这里下载:https://gitee.com/haebong/wordpress-redis-cache</p>
	<p><font color=red>请先设置后再使用</font></p>
</div>
		<?php
		}else{
	?>
<div class="wrap">
    <h1>Redis清除缓存</h1>
	<p>注意:此插件需要配合带有Redis缓存功能的ndex.php,可以到这里下载:https://gitee.com/haebong/wordpress-redis-cache</p>
	<form method="post" action="">
		<table class="form-table">
			<tr>
				<th>完整地址:</th>
				<td><code><?php echo get_option('sp_redis_url').get_option('sp_redis_command'); ?></code></td>
			</tr>
			<tr>
				<th>网址URL:</th>
				<td><code><?php echo get_option('sp_redis_url'); ?></code></td>
			</tr>
			<tr>
				<th>删除指令:</th>
				<td><code><?php echo get_option('sp_redis_command'); ?></code></td>
			</tr>
			<tr>
				<th>成功指令:</th>
				<td><code><?php echo get_option('sp_redis_request'); ?></code></td>
			</tr>
			<tr>
				<th>无缓存指令:</th>
				<td><code><?php echo get_option('sp_redis_request_no'); ?></code></td>
			</tr>
		</table>
		<p class="submit">
			<input type="submit" name="sp_redis_delete" class="button-primary" value="清除Redis缓存"/>
		</p>
	</form>
</div>
<?php
		}
	}

function sp_redis_menu_seting(){
	if (!empty(get_option('sp_redis_url'))){
		$home_url = get_option('sp_redis_url');
	}else{
		$home_url = home_url().'/';
	}
?>
<div class="wrap">
    <h1>设置</h1>
	<form method="post" action="">
		<table class="form-table">
			<tr>
				<th>网址URL:</th>
				<td><input name="sp_redis_url" type="text" id="sp_redis_url" class="regular-text" value="<?php echo $home_url; ?>">
				* 网站URL,例如https://6ns.net/,必须以/结尾
				</td>
			</tr>
			<tr>
				<th>清除指令:</th>
				<td><input name="sp_redis_command" type="text" id="sp_redis_command" class="regular-text" value="<?php echo get_option('sp_redis_command'); ?>">
				* 指令在index.php里设置,输入完整的清除指令,例如?c=yy
				</td>
			</tr>
			<tr>
				<th>成功指令:</th>
				<td><input name="sp_redis_request" type="text" id="sp_redis_request" class="regular-text" value="<?php echo get_option('sp_redis_request'); ?>">
				* 缓存清除成功后服务器输出的内容,用于判断状态</td>
			</tr>
			<tr>
				<th>无缓存指令:</th>
				<td><input name="sp_redis_request_no" type="text" id="sp_redis_request_no" class="regular-text" value="<?php echo get_option('sp_redis_request_no'); ?>">
				* 缓存没有被清除或无缓存时,用于判断状态</td>
			</tr>
		</table>
		<p class="submit">
			<input type="submit" name="sp_redis_save" class="button-primary" value="保存到数据库"/>
		</p>
	</form>
</div>
<?php
	}
} // #class
?>